import fetch from '@/utils/fetch';

const clientInfo = {
  appId: '__UNI__601F7F9',
  uniPlatform: 'web',
  deviceId: '17455469310423028166',
};

export const login = (data) => {
  return fetch({
    url: '/uni-id-co/login',
    method: 'POST',
    isToast: true,
    data: {
      clientInfo: clientInfo,
      params: data,
    },
  });
};

export const logout = (data) => {
  return fetch({
    url: '/uni-id-co/logout',
    method: 'POST',
    data: {
      clientInfo: clientInfo,
      params: data,
    },
  });
};

export const registerUser = (data) => {
  return fetch({
    url: '/uni-id-co/registerUser',
    method: 'POST',
    data: {
      clientInfo: clientInfo,
      params: data,
    },
  });
};

export const createCaptcha = (data) => {
  return fetch({
    url: '/uni-id-co/createCaptcha',
    method: 'POST',
    data: {
      clientInfo: clientInfo,
      params: data,
    },
  });
};

// 获取用户信息
export const getUser = (data) => {
  return fetch({
    url: '/web-admin/user/getUser',
    method: 'POST',
    data,
  });
};

// 全部类型
export const allTypeGroup = (data) => {
  return fetch({
    url: '/web-admin/common/allTypeGroup',
    method: 'POST',
    data,
  });
};

export const userListGroup = (data) => {
  return fetch({
    url: '/web-admin/common/userListGroup',
    method: 'POST',
    data,
  });
};

export const uploadFile = (data) => {
  return fetch({
    url: '/web-admin/common/uploadFile',
    method: 'POST',
    data,
  });
};

export const pageListUser = (data) => {
  return fetch({
    url: '/web-admin/user/pageListUser',
    method: 'POST',
    data,
  });
};

export const pageListUserLog = (data) => {
  return fetch({
    url: '/web-admin/user/pageListUserLog',
    method: 'POST',
    data,
  });
};
